//
//  ViewController.m
//  TableView
//
//  Created by LiJonius on 16/4/25.
//  Copyright © 2016年 LiJonius. All rights reserved.
//

#import "ViewController.h"
#import "LeftTableView.h"
#import "RightTableView.h"
@interface ViewController ()
@property (nonatomic,strong)LeftTableView* leftTableView;
@property (nonatomic,strong)RightTableView* rightTableView;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    __weak typeof(self) weakSelf = self;
    self.leftTableView = [[LeftTableView alloc]initWithFrame:CGRectMake(0, 0, 80, self.view.frame.size.height-64)];
    self.leftTableView.backgroundColor = [UIColor cyanColor];
    [self.view addSubview:self.leftTableView];
    self.leftTableView.callBack=^(NSIndexPath* indexPath){
    
        NSLog(@"---%ld",(long)indexPath.row);
        //滚动cell
        //[weakSelf.rightTableView.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionTop animated:YES];
        
        //
        [weakSelf.rightTableView.tableView setContentOffset:CGPointMake(0, indexPath.row*44*10+indexPath.row*14) animated:YES];
        //indexPath.row*44*10+indexPath.row*14 indexPath.row* cellHeight*secion中cell的个数＋sectionheader 的高度；
    };
    
    self.rightTableView = [[RightTableView alloc]initWithFrame:CGRectMake(80, 0, self.view.frame.size.width - 80, self.view.frame.size.height - 64)];
    self.rightTableView.backgroundColor = [UIColor cyanColor];
    [self.view addSubview:self.rightTableView];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
